package com.lft00.common;

import org.apache.commons.io.FileUtils;

import java.io.File;
import java.io.IOException;
import java.net.URL;

/**
 * Function: 		A {@code LFTDL} object With Some FUNCTION.<br/>
 * Reason:   		ADD REASON.<br/>
 * Date:            2021-01-26 15:37<br/>
 * <p>
 * Class Name:      LFTDL<br/>
 * Package Name:    com.lft.thread<br/>
 * @author Laifengting / E-mail:laifengting@foxmail.com
 * @version 1.0.0
 * @since JDK 8
 */
public class WebDownloader {
	public static void downloadFile(String url, String name) {
		try {
			FileUtils.copyURLToFile(new URL(url), new File(name));
		} catch (IOException e) {
			e.printStackTrace();
			System.out.println("IO异常，downloader方法出现问题");
		}
	}
}
